home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
CU Amiga Super CD-ROM 22
/
CU Amiga Magazine's Super CD-ROM 22 (1998)(EMAP Images)(GB)[!][issue 1998-05].iso
/
PowerPC
/
Programming
/
PPCSmallEiffel
/
bin_c
/
pretty16.c
< prev
next >
Wrap
C/C++ Source or Header
|
1998-01-16
|
5KB
|
193 lines
/*
-- ANSI C code generated by :
-- SmallEiffel The GNU Eiffel Compiler -- Release (- 0.82) --
-- Copyright (C), 1994-98 - LORIA - UHP - CRIN - INRIA - FRANCE --
-- Dominique COLNET and Suzanne COLLIN - colnet@loria.fr --
-- http://www.loria.fr/SmallEiffel --
*/
#include "pretty.h"
T0* r636append(T636* C,T0* a1){
T0* R=NULL;
/*IF*/if ((((C)==((void*)(a1)))||(/*(IRF4.7is_omitted*/((((T636*)C))->_start_position/*0*/)==(NULL)/*)*/))||(r636gives_permission_to_any(C))) {
R=(T0*)C;
}
else if ((/*(IRF4.7is_omitted*/((((T636*)((T636*)a1)))->_start_position/*0*/)==(NULL)/*)*/)||(r636gives_permission_to_any(((T636*)a1)))) {
R=a1;
}
else {
{T636*n=malloc(sizeof(*n));
*n=M636;
r636merge(n,(((T636*)C))->_start_position/*0*/,(((T636*)C))->_list/*4*/,(((T636*)((T636*)a1)))->_list/*4*/);
R=(T0*)n;
}
}
/*FI*/return R;
}
T0* r358add_comment(T358* C,T0* a1){
T0* R=NULL;
/*IF*/if (((a1)==((void*)(NULL)))||((/*(IRF4.6count*/r52count(((T52*)((((T393*)((T393*)a1)))->_list/*4*/)))/*)*/)==(0))) {
R=(T0*)C;
}
else {
{T529*n=malloc(sizeof(*n));
*n=M529;
r529make(n,(T0*)C,a1);
R=(T0*)n;
}
}
/*FI*/return R;
}
int r358to_integer(T358* C){
int R=0;
r358error((((T358*)C))->_start_position/*16*/,((T0*)ms69_470));
return R;
}
int r358is_a(T358* C,T0* a1){
int R=0;
R=X291is_a(X291run_type(/*(IRF4.3result_type*/(((T358*)C))->_current_type/*4*//*)*/),X291run_type(X662result_type(a1)));
/*IF*/if (!(R)) {
r683add_position((((T358*)C))->_start_position/*16*/);
r358error(X662start_position(a1),((T0*)ms4_662));
}
/*FI*/return R;
}
/*No:E_CURRENT.is_current*/
/*No:E_CURRENT.is_written*/
void r358make(T358* C,T0* a1,int a2){
C->_start_position=a1;
C->_is_written=a2;
C->_to_string=((T0*)ms143_473);
}
void r358print_as_target(T358* C){
/*IF*/if (((((T358*)C))->_is_written/*12*/)||(r238print_current(((T238*)(oBC364fmt))))) {
r238put_string(((T238*)(oBC364fmt)),((T0*)ms143_473));
r238put_character(((T238*)(oBC364fmt)),'\56');
}
/*FI*/}
/*No:E_CURRENT.us_current*/
/*No:E_CURRENT.to_string*/
/*No:E_CURRENT.fz_iinaiv*/
/*No:E_CURRENT.start_position*/
/*No:E_CURRENT.precedence*/
T0* r358to_runnable(T358* C,T0* a1){
T0* R=NULL;
/*IF*/if (((((T358*)C))->_current_type/*4*/)==((void*)(NULL))) {
C->_current_type=a1;
R=(T0*)C;
}
else if (((((T358*)C))->_current_type/*4*/)==((void*)(a1))) {
R=(T0*)C;
}
else {
{T358*n=malloc(sizeof(*n));
*n=M358;
r358make(n,(((T358*)C))->_start_position/*16*/,(((T358*)C))->_is_written/*12*/);
R=(T0*)n;
}
/*[IRF3.3set_current_type*/((((T358*)(((T358*)R))))->_current_type)=(a1);
/*]*/
}
/*FI*/return R;
}
/*No:E_CURRENT.bracketed_pretty_print*/
/*No:E_CURRENT.result_type*/
/*No:E_CURRENT.set_current_type*/
/*No:E_CURRENT.atomic_precedence*/
/*No:E_CURRENT.pretty_print*/
/*No:E_CURRENT.current_type*/
/*No:E_CURRENT.is_manifest_string*/
/*No:E_CURRENT.is_void*/
void r358error(T0* a1,T0* a2){
r683add_position(a1);
r683error(((T683*)(oBC364eh)),a2);
}
void r592make(T592* C,T0* a1,T0* a2){
C->_header_comment=a1;
C->_list=a2;
}
/*No:COMPOUND.nb_errors*/
T0* r592to_runnable(T592* C,T0* a1){
T0* R=NULL;
T0* _i2=NULL;
T0* _i1=NULL;
int _i=0;
/*IF*/if (((((T592*)C))->_current_type/*4*/)==((void*)(NULL))) {
C->_current_type=a1;
/*IF*/if (((((T592*)C))->_list/*8*/)!=((void*)(NULL))) {
_i=(((T419*)((T419*)((((T592*)C))->_list/*8*/))))->_upper/*8*/;
while (!((_i)==(0))) {
_i1=r419item(((T419*)((((T592*)C))->_list/*8*/)),_i);
_i2=X465to_runnable(_i1,(T0*)C);
/*IF*/if ((/*(IRF4.9nb_errors*/(((T683*)((T683*)(oBC364eh))))->_nb_errors/*0*//*)*/)>(0)) {
/*[IRF3.6append*/{T0* b1=((T0*)ms1_592);
r7append(((T7*)(oBC683explanation)),b1);
}/*]*/
/*[IRF3.6append*/{T0* b1=X291written_mark((((T592*)C))->_current_type/*4*/);
r7append(((T7*)(oBC683explanation)),b1);
}/*]*/
r683add_position(X465start_position(_i1));
/*[IRF3.6fatal_error*/{T0* b1=((T0*)ms2_592);
r683fatal_error(((T683*)(oBC364eh)),b1);
}/*]*/
}
else {
/*[IRF3.6put*/{T419* C1=((T419*)((((T592*)C))->_list/*8*/));
T0* b1=_i2;
int b2=_i;
((((T419*)C1))->_storage/*0*/)[(b2)-((((T419*)C1))->_lower/*12*/)]=(b1);
}/*]*/
}
/*FI*/_i=(_i)-(1);
}
}
/*FI*/R=(T0*)C;
}
else {
/*IF*/if (((((T592*)C))->_list/*8*/)==((void*)(NULL))) {
{T592*n=malloc(sizeof(*n));
*n=M592;
r592make(n,(((T592*)C))->_header_comment/*0*/,NULL);
R=(T0*)n;
}
}
else {
{T592*n=malloc(sizeof(*n));
*n=M592;
r592make(n,(((T592*)C))->_header_comment/*0*/,r419twin(((T419*)((((T592*)C))->_list/*8*/))));
R=(T0*)n;
}
}
/*FI*/R=r592to_runnable(((T592*)R),a1);
}
/*FI*/return R;
}
void r592pretty_print(T592* C){
int _i=0;
r238level_incr(((T238*)(oBC364fmt)));
r238indent(((T238*)(oBC364fmt)));
/*IF*/if (((((T592*)C))->_header_comment/*0*/)!=((void*)(NULL))) {
r393pretty_print(((T393*)((((T592*)C))->_header_comment/*0*/)));
}
/*FI*//*IF*/if (((((T592*)C))->_list/*8*/)!=((void*)(NULL))) {
_i=1;
while (!((_i)>((((T419*)((T419*)((((T592*)C))->_list/*8*/))))->_upper/*8*/))) {
/*[IRF3.3set_semi_colon_flag*/((((T238*)(((T238*)(oBC364fmt)))))->_semi_colon_flag)=(1);
/*]*/
r238indent(((T238*)(oBC364fmt)));
X465pretty_print(r419item(((T419*)((((T592*)C))->_list/*8*/)),_i));
_i=(_i)+(1);
}
}
/*FI*/r238level_decr(((T238*)(oBC364fmt)));
}
/*No:COMPOUND.list*/
/*No:COMPOUND.current_type*/
T0* r592run_class(T592* C){
T0* R=NULL;
R=X291run_class((((T592*)C))->_current_type/*4*/);
return R;
}
/*No:COMPOUND.header_comment*/
/*No:COMPOUND.fatal_error*/